Use Rsync+lsync implement triggered real-time synchronizationServer informationcentos6.5Main: 192.168.5.4 Build Lsyncfrom: 192.168.5.3 Build rsync1.1 from server settings# yum-y Install rsync xinetd# cp/etc/xinetd.d/rsync/etc/xinetd.d/rsync.blk# Vim/etc/xinetd.d/rsync# Default:off# description:the Rsync server is a good addition to an FTP server, as it \# allows CRC Checksumming etc.Service Rsync{ Disable = no→ Modify 'Yes 'as 'No ' fla
Using rsync + Lsync to achieve real-time file synchronization, this article describes how to configure Rsync + Lsync. and test the file synchronization function.Server information:
Main: 10.86.255.154From: 10.86.255.155
1. From the service set up.
1.1. Installation configuration rsync xinet.
# yum-y Install rsync xinet# cp/etc/xinetd.d/rsync/etc/xinetd.d/rsync.bkp0625# Vim/etc/xinetd.d/rsync# Default:of
rootbindaemonadmlpsyncshutdownhalt ...... (Omitted )......
Or print out the home directory of the user and the user at the same time:
[Root @ CentOS ~] # Cat/etc/passwd | cut-f 1,6-d': 'root:/rootbin:/bindaemon:/sbinadm:/var/admlp:/var/spool/lpdsync: /sbinshutdown:/sbinhalt:/sbin ..... (skip the content )......
Or print the logon shell (that is, the shell used for user logon) for each user at the same time ):
[Root @ CentOS ~] # Cat/etc/passwd | cut-f 1,6-7-d ': 'root:/root:/bin/bashbin:/bin:/s
This script is the second update. It has been widely used in a large media website system and added some security settings that were not previously imagined. Copy it and save it as a shell file, such as security. sh. upload it to the linux server. Execute sh security. sh to use this script!
#!/bin/sh
#desc:setuplinuxsystemsecurity
#author:coralzd
#poweredbywww.freebsdsystem.org
#version0.1.2writtenby2011.05.03
#accountsetup
passwd-lxfs
passwd-lnews
passwd-lnscd
passwd-
Recently, the Lsync synchronization discovery is slow, so the files are synchronized through the pipeline after the script.The contents are as follows:#!/usr/bin/pythonimportparamikoimportosimportsysimport TIMEIMPORTNBSP;MULTIPROCESSINGIMPORTNBSP;DATETIMENBSP;IP_LISTNBSP;=NBSP;[]ROOM_IDNBSP;=NBSP;SYS.ARGV[1] Cur_time=datetime.datetime.now () defupfile (Host_ip,local_path,remote_path): privatekey=os.path.expanduser ('/root/.ssh/id_rsa ') key=paramiko .
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.